/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pojo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author A7med Kotb
 */
@Entity
@Table(name = "careers")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Careers.findAll", query = "SELECT c FROM Careers c"),
    @NamedQuery(name = "Careers.findByCId", query = "SELECT c FROM Careers c WHERE c.cId = :cId"),
    @NamedQuery(name = "Careers.findByName", query = "SELECT c FROM Careers c WHERE c.name = :name"),
    @NamedQuery(name = "Careers.findByEmail", query = "SELECT c FROM Careers c WHERE c.email = :email"),
    @NamedQuery(name = "Careers.findByPhoneNo", query = "SELECT c FROM Careers c WHERE c.phoneNo = :phoneNo"),
    @NamedQuery(name = "Careers.findByMobileNo", query = "SELECT c FROM Careers c WHERE c.mobileNo = :mobileNo"),
    @NamedQuery(name = "Careers.findByJobReference", query = "SELECT c FROM Careers c WHERE c.jobReference = :jobReference"),
    @NamedQuery(name = "Careers.findByExperience", query = "SELECT c FROM Careers c WHERE c.experience = :experience"),
    @NamedQuery(name = "Careers.findByCvUrl", query = "SELECT c FROM Careers c WHERE c.cvUrl = :cvUrl")})
public class Careers implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "c_id")
    private Integer cId;
    @Size(max = 100)
    @Column(name = "name")
    private String name;
    // @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Invalid email")//if the field contains email address consider using this annotation to enforce field validation
    @Size(max = 100)
    @Column(name = "email")
    private String email;
    @Size(max = 10)
    @Column(name = "phone_no")
    private String phoneNo;
    @Size(max = 15)
    @Column(name = "mobile_no")
    private String mobileNo;
    @Size(max = 100)
    @Column(name = "job_reference")
    private String jobReference;
    @Column(name = "experience")
    private Integer experience;
    @Lob
    @Size(max = 65535)
    @Column(name = "comments")
    private String comments;
    @Size(max = 100)
    @Column(name = "cv_url")
    private String cvUrl;

    public Careers() {
    }

    public Careers(Integer cId) {
        this.cId = cId;
    }

    public Integer getCId() {
        return cId;
    }

    public void setCId(Integer cId) {
        this.cId = cId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhoneNo() {
        return phoneNo;
    }

    public void setPhoneNo(String phoneNo) {
        this.phoneNo = phoneNo;
    }

    public String getMobileNo() {
        return mobileNo;
    }

    public void setMobileNo(String mobileNo) {
        this.mobileNo = mobileNo;
    }

    public String getJobReference() {
        return jobReference;
    }

    public void setJobReference(String jobReference) {
        this.jobReference = jobReference;
    }

    public Integer getExperience() {
        return experience;
    }

    public void setExperience(Integer experience) {
        this.experience = experience;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    public String getCvUrl() {
        return cvUrl;
    }

    public void setCvUrl(String cvUrl) {
        this.cvUrl = cvUrl;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cId != null ? cId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Careers)) {
            return false;
        }
        Careers other = (Careers) object;
        if ((this.cId == null && other.cId != null) || (this.cId != null && !this.cId.equals(other.cId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pojo.Careers[ cId=" + cId + " ]";
    }
    
}
